package com.shopnight.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shopnight.entity.TakeoutSlideshow;
import com.shopnight.service.TakeoutSlideshowService;
import com.shopnight.mapper.TakeoutSlideshowMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 13201
* @description 针对表【takeout_slideshow】的数据库操作Service实现
* @createDate 2023-03-09 22:11:24
*/
@Service
public class TakeoutSlideshowServiceImpl extends ServiceImpl<TakeoutSlideshowMapper, TakeoutSlideshow>
    implements TakeoutSlideshowService{
    @Autowired
    TakeoutSlideshowMapper takeoutSlideshowMapper;

    @Override
    public List<TakeoutSlideshow> getTakeoutSlideshow(Integer orgId) {
        List<TakeoutSlideshow> takeoutSlideshows = takeoutSlideshowMapper.selectList(
                new LambdaQueryWrapper<TakeoutSlideshow>()
                        .eq(TakeoutSlideshow::getOrgId,orgId)
                        .orderByAsc(TakeoutSlideshow::getSort)
        );
        return takeoutSlideshows;
    }
}




